home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ADASTupleDatabase.h
-
- Copyright: © 1991-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Part of the AOCE Sample SMSAM Package. Consult the license
- which came with this software for your specific legal rights.
-
- */
-
-
-
- #ifndef __ADASTUPLEDATABASE__
- #define __ADASTUPLEDATABASE__
-
- #ifndef __BLJSTANDARDINCLUDES__
- #include "BLJStandardIncludes.h"
- #endif
-
- #ifndef __OCEAUTHDIR__
- #include "OCEAuthDir.h"
- #endif
-
- class TADASTupleDatabase {
- // Creation/Deletion methods
- public:
- TADASTupleDatabase();
- public:
- virtual ~TADASTupleDatabase();
-
- // Access methods
- public:
- virtual Boolean GetTupleSize(void* key, long keySize, long &dataSize);
-
- virtual Boolean GetTuple(void* key, long keySize); // test for existence
- virtual Boolean GetTuple(void* key, long keySize, long& actualDataSize, void *data = NULL, long dataSize = 0);
- /*finds the data associated with the key*/
- /*and copies it into the space that ‘data’ points to*/
-
- virtual Boolean SetTuple(void *key, long keySize, void *data, long dataSize);
- /*adds or updates a tuple with the given key and data*/
-
- virtual Boolean DeleteTuple(void *key, long keySize);
- /*removes the tuple that matches the tuple’s key*/
-
- virtual long CountTuples();
- /*returns the number of tuples in the database*/
-
- virtual Boolean GetIndexTuple(long i, void *key, long &keySize);
- virtual Boolean GetIndexTuple(long i, void *key, long &keySize, void *data, long &dataSize);
- /*gets the indexed tuple’s key and data from the database*/
-
- virtual Boolean FindIndexOfTuple(void *key, long keySize, long &i);
-
- virtual Boolean SetIndexTuple(long i, void *data, long dataSize);
-
- virtual void Flush(void);
-
- virtual Boolean IADASTupleDatabase (AuthIdentity identityToUse, short dsRefNum, RecordIDPtr ourRecord, AddrBlock* serverHint = nil);
-
- virtual Boolean CreateDatabase();
- virtual Boolean DeleteDatabase ();
-
- protected:
- virtual Boolean GetAttributeFromADASAttributeTypeAndIndex(AttributeType& attrType, long index, CreationID& cid, AttributeTag& tag, void* data, long& dataSize);
- virtual Boolean GetIndexAttribute (long i, AttributeType& attrType);
-
- protected:
- AuthIdentity fAuthIdentity;
- RecordIDPtr fRecordIDPtr;
- AddrBlock fServerHint;
- short fDirRefNum;
- };
-
- /***********************************|****************************************/
-
- #endif
-